<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Konten extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->model('Konten_model');
		$this->load->model('Produk_model');
		$this->load->library('session');
		$this->load->helper('url');
		$this->load->helper('bantuan_helper');
		
		
	}
	

	function profile()
	{
		$data['current5'] = 'current'; // FOR MENU
		$data['cumb'] = anchor('home','<strong>Home</strong>').' &raquo;  Profile';	
		$data['ses_id'] = $this->session->userdata('session_id');
		$data['title'] = 'About Us';
		$data['row'] = $this->Konten_model->getKonten('profile',FALSE,FALSE,FALSE,FALSE);
		
		$data['page'] = 'common'; // ONE RULE TO SHOW THE SIDEBAR
		$data['main_view'] = 'slak/konten_view';
		$this->load->view('/slak/index',$data);
	
	}
	
	function faq()
	{
		$data['ses_id'] = $this->session->userdata('session_id');
		$data['title'] = 'F.A.Q';
		$data['row'] = $this->Konten_model->getKonten('faq',FALSE,FALSE,FALSE,FALSE);
		$data['main_view'] = 'konten_view';
		$this->load->view('/index',$data);
	}
	
	function archive()
	{
		$this->load->library('pagination');
		$offset = $this->uri->segment(3);
		$config['base_url'] = site_url().'/konten/archive';
		$config['total_rows'] = count($this->Konten_model->getKonten('berita','all_front',FALSE,FALSE,FALSE));
		$config['per_page'] = 2;
		$config['uri_segment'] = 3;
		$config['next_link'] = '&raquo;';
		$config['prev_link'] = '&laquo;';
		$data['ses_id'] = $this->session->userdata('session_id');
		$data['title'] = 'Arsip Sekilas Info';
		$data['res'] = $this->Konten_model->getKonten('berita','all_front',FALSE,$config['per_page'],$offset);
		$this->pagination->initialize($config);
		$data['main_view'] = 'archive_view';
		$this->load->view('/index',$data);
	}
	
}



/* End of file welcome.php */
/* Location: ./system/application/controllers/home.php */